#pragma once

#include "CoreMinimal.h"
#include "Widgets/SCompoundWidget.h"

DECLARE_LOG_CATEGORY_EXTERN(LogSContentView, Log, All)

class SContentView : public SCompoundWidget
{
private:
	TSharedPtr<SVerticalBox> ContentVB;
	double StartTime;
	bool bSelfCopy = false;
	TMap<class SContentTextItem*, FString> CopyContent;
	int ItemIndex = 0;
	uint32 ItemMax = 200;
private:
	FReply OnTestItem();
	FReply OnCopy();

	void ProcessCopy();

	void OnContentTextItemSelectionChanged(const bool bSelected, class SContentTextItem* ContentTextItem,const FString& Content);

	void ClearCopy();

public:
	SLATE_BEGIN_ARGS(SContentView)
	{
	}
	SLATE_END_ARGS()

	SContentView();
	virtual	~SContentView();

	/** Widget constructor */
	void Construct(const FArguments& Args);

	void OnClipBoardStringChange(const FString& Content);
	void OnWindowDeactivated();


	/**
	 * Called after a key is released when this widget has focus
	 *
	 * @param MyGeometry The Geometry of the widget receiving the event
	 * @param InKeyEvent  Key event
	 * @return Returns whether the event was handled, along with other possible actions
	 */
	virtual FReply OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
};